package cn.csxw.openchina.ui.fragment.myMessageFragment;
import android.os.Bundle;
import android.support.annotation.Nullable;

import java.util.ArrayList;

import javax.inject.Inject;

import cn.csxw.openchina.base.BaseRecAdapter;
import cn.csxw.openchina.base.BaseRefreshFragment;
import cn.csxw.openchina.constant.Constant;
import cn.csxw.openchina.dagger2.component.DaggerMyMessageFtComponent;
import cn.csxw.openchina.dagger2.module.module_myFragment.MyMessageFragmentModules;
import cn.csxw.openchina.dagger2.presenter.MyMessageFragmentPresenter;
import cn.csxw.openchina.entity.bean.ActiveBean;
import cn.csxw.openchina.ui.adapter.adapter_myMessage.MyMessageAdapter;
import cn.csxw.openchina.utils.Global;

/**
 * C我的---》消息--@我
 */
public class MyMessageFragment extends BaseRefreshFragment {

    public MyMessageAdapter mAdapter;
    @Inject
    public MyMessageFragmentPresenter mFragmentPresenter;
    @Override
    protected BaseRecAdapter getAdapter() {
        ArrayList<ActiveBean> activeBeen = new ArrayList<>();
        if (mAdapter==null){

            mAdapter = new MyMessageAdapter(activeBeen);
        }
        return mAdapter;
    }

    @Override
    public void doRefresh() {

    }
    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        DaggerMyMessageFtComponent.builder()
                .myMessageFragmentModules(new MyMessageFragmentModules(this))
                .build()
                .inject(this);
        mFragmentPresenter.callNetWork(Global.getUserUid(Constant.USER_UID),0,2,20);
        Global.onNetworkStateListener(mFragmentPresenter,this);
    }
}
